package com.example.demo.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

/**
 * Author by admin, Email xx@xx.com, Date on 2019/8/5.
 * PS: Not easy to write code, please indicate.
 */

@Data
@NoArgsConstructor
@AllArgsConstructor
@Document(indexName = "qa_index")
public class SearchQuestion implements Serializable {
        @Id
        private Long id;
        //是否被索引，看该该域能否被搜索 (存，查，都分词)
        @Field(index = true,type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
        private String title;
        private String description;

        private Long creator;
        private Integer commentCount;
        private Integer viewCount;
        private Integer thumbup;
        private Integer likeCount;
        private String tag;
        private String state;
}

